process a message
To process a message, XgrProcessMessages() calls the window function the message refers to
directly or indirectly. For window messages, XgrProcessMessages() calls the window
function assigned to the window argument. For grid messages, XgrProcessMessages() calls
the window function assigned to the window that contains the grid argument.
XgrProcessMessages() passes the 8 XLONG message arguments to the functions it calls. All
window functions accept 8 arguments. But window functions sometimes expect to receive
other types from GuiDesigner and your program. So the last argument of window functions is
declared to be ANY type to also accept STRING variables and all types of arrays.
Window functions are usually declared and defined as follows:
DECLARE FUNCTION Name ( wingrid, message, v0, v1, v2, v3, r0, ANY )
FUNCTION Name ( wingrid, message, v0, v1, v2, v3, r0, (r1, r1$) )
XgrProcessMessages() calls window functions as follows:
@func ( wingrid, message, v0, v1, v2, v3, r0, r1 )
window function
Every window is assigned a window function when it is created. In response to CreateWindow
messages, most grid functions assign standard window function XuiWindow() .
Most GUI programs rely entirely on the standard window function supplied with GuiDesigner,
XuiWindow() . Only when special message processing is necessary and cannot be handled in
other ways should you write custom window functions. Custom window functions should only
contain code to perform actions that existing standard window functions do not provide.
Messages not requiring custom processing should be passed on to the existing standard
window function for default processing. Those that do require custom processing should be
passed to an existing standard window function either before or after custom processing,
whichever is appropriate. Exceptions are possible, but not common.